package org.dce.screencapturer.util;

import java.util.HashMap;
import java.util.Map;

import javax.swing.Icon;
import javax.swing.ImageIcon;

public class IconFactory {

	private static final Map<String,Icon> icons = new HashMap<String,Icon>();
	
	public static Icon getIcon(String location){
		
		Icon icon = icons.get(location);
		if (icon == null){
			icon = new ImageIcon(IconFactory.class.getResource(location));
			icons.put(location, icon);
		}
		
		return icon;
	}
}
